﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - 易购商城</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/shop_style.css" />
    <link rel="stylesheet" href="~/css/shop_purchase.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/EasyBuyShop.styles.css" asp-append-version="true" />
</head>
<body>
    <header class="py-3 mb-3 border-bottom container" style="padding-left: 0px;padding-right: 0px;">
        <div class="container-fluid d-grid gap-3 align-items-center" style="grid-template-columns: 1fr 9fr;width:100%;padding-left: 0px;padding-right: 0px;">
            <div class="dropdown">
                <a href="/Home/Index" class="d-flex align-items-center col-lg-4 mb-2 mb-lg-0 link-dark text-decoration-none dropdown-toggle">
                    <h2>易购商城</h2>
                </a>
            </div>

            <div class="d-flex align-items-center">
                <form class="w-100 me-3" role="search" action="/Product/Index/">
                    <div>
                        <input type="search" class="form-control" placeholder="商品名称" aria-label="Search" style="width:85%;display:inline-block;line-height:1.7" name="productName">
                        <button type="submit" class="btn btn-outline-primary">搜索</button>
                    </div>
                </form>

                <div class="flex-shrink-0 dropdown">
                    @{
                        var userName = ViewData["Username"]?.ToString();
                        var realName = ViewData["RealName"]?.ToString();

                        @if (!string.IsNullOrEmpty(userName))
                        {
                            <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                                <span>@realName</span>
                            </a>
                            <ul class="dropdown-menu text-small shadow" style="">
                                <li><a class="dropdown-item" href="/Purchase/Index">订单管理</a></li>
                                <li><a class="dropdown-item" href="/Cart/Index">购物车</a></li>
                                <li><a class="dropdown-item" href="/Personal/Setting">设置</a></li>
                                <li><a class="dropdown-item" href="/Personal/Index">个人信息</a></li>
                                <li><hr class="dropdown-divider"></li>
                                <li><a class="dropdown-item" href="/Auth/Logout">登出</a></li>
                            </ul>
                        }
                        else
                        {
                            <a href="/Auth/Login" class="d-block link-dark text-decoration-none">
                                <span>亲，请登录</span>
                            </a>
                        }
                    }

                </div>
            </div>
        </div>
    </header>
    <div class="container" style="padding-left:0px;padding-right:0px;">
        <main role="main" class="pb-3">
            @RenderBody()
        </main>
    </div>
    <footer class="py-3 my-4 border-top footer text-muted" style="line-height:10px;margin-bottom:0.5rem!important;">
        <p class="text-center text-muted">© 2023-2024 易购商城 老码识途 公子小六</p>
    </footer>
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>
